package com.bsi.rd.framework.zuul.service.impl;/*
 * Author: liusongs
 * Date: 2019/10/18 16:17
 * Content:
 */

import com.bsi.rd.framework.zuul.service.PermissonService;
import org.springframework.stereotype.Service;

@Service
public class DefaultPermissonService implements PermissonService {
    @Override
    public boolean checkPermisson(String userId, String uri) {
        /*Map<String, List<Map<String, Object>>> permissionsMap = redisTemplate.opsForHash().entries(userId);
        if (MapUtils.isEmpty(permissionsMap)) {
            redisService.initPermission(userId);
            permissionsMap = redisTemplate.opsForHash().entries(userId);
        }
        List<Map<String, Object>> permissionList = permissionsMap.get(userId);
        if (CollectionUtils.isNotEmpty(permissionList)) {
            checkOut:
            for (Map<String, Object> permissionMap : permissionList) {
                String url = MapUtils.getString(permissionMap, "menuurl");
                if (requestURI.equals(url)) {
                    checkPermission = true;
                    logger.info("userId:{}, requestURI:{} 权限校验通过", userId, requestURI);
                    break checkOut;
                }
            }
        }*/
        return true;
    }
}
